package com.designpatterns.observer.subject;

import java.util.ArrayList;
import java.util.List;

import com.designpatterns.observer.observer.Policeman;

/**
 * Citizen abstract Class
 * 
 * @author Haiqi.Wang
 * @since 2013-6-9下午5:20:37
 */
public abstract class Citizen {
	protected List<Policeman> pols;
	String help = "normal";

	public String getHelp() {
		return help;
	}

	public void setHelp(String help) {
		this.help = help;
	}

	public abstract void sendMessage(String help);
	
	public void setPoliceman() {
		this.pols = new ArrayList<Policeman>();
	}
	
	public void register(Policeman pol) {
		this.pols.add(pol);
	}
	
	public void unRegister(Policeman pol) {
		this.pols.remove(pol);
	}
}
